<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">

    <title>金信诺网管系统</title>
    <link rel="stylesheet" href="frame/layui/css/layui.css">
    <link rel="stylesheet" href="frame/static/css/style.css">
    <link rel="stylesheet" href="css/public_style.css"/>
    <style>
        .my-side ul.layui-nav li>a i{
            background-repeat: no-repeat;
            background-size: 100%;
            position: relative;
            top: 14px;
            height: 15px;
        }
    </style>
</head>
<body>
<!-- version 2.0 -->
<div class="layui-header">
    <div class="layui-header-search layui-min-width" style="min-width:1366px">
        <!--<div class="fl header-logo">-->
            <!--<img id="head-img" src="frame/static/image/browser-error.png"  style="margin-left: 32px"/>-->
        <!--</div>-->
        <div class="header-right">
            <div class="fl login-name">
                运营商：嘟嘟嘟
            </div>
            <div class="fr">
                <div class="fl warning">
                    <button type="button" class="warning-btn yellow-bg">总数量<span class="warningNum"></span></button>
                    <button type="button" class="warning-btn red-bg">严重<span class="critical"></span></button>
                    <button type="button" class="warning-btn blue-bg">主要<span class="major"></span></button>
                    <button type="button" class="warning-btn Lavender-bg">次要<span class="minor"></span></button>
                    <button type="button" class="warning-btn gray-bg">不确定量<span class="minor"></span></button>
                </div>
                <div class="fl refresh">
                    <img src="frame/static/image/refresh.png"/>
                    <a class="alarmStatistics" href="javascript:;">刷新</a>
                </div>
                <div class="fl">
                    <a id="login_name" class="border-right"></a>
                </div>
                <div class=" main-logOut" id="btn_logout">退出</div>
            </div>
        </div>
    </div>
</div>

<!-- layout admin -->
<div class="layui-layout layui-layout-admin">
    <div class="layui-side my-side">
        <div class="layui-side-scroll">
            <!-- 左侧主菜单添加选项卡监听 -->
            <ul class="layui-nav layui-nav-tree" lay-filter="side-main"></ul>
        </div>
    </div>

    <div class="layui-body my-body main-body" style="min-width:1146px">
        <div class="layui-tab layui-tab-card my-tab layui-min-width" lay-filter="card" lay-allowClose="true">
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show" style="position: relative;">
                    <iframe id="iframe" src="html/index.html" frameborder="0" style="min-width:1146px"></iframe>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 右键菜单 -->
<div class="my-dblclick-box none">
    <table class="layui-tab dblclick-tab">
        <!--<tr class="card-close">-->
            <!--<td><i class="layui-icon">&#x1006;</i>关闭当前标签</td>-->
        <!--</tr>-->
        <tr class="card-closeOther">
            <td><i class="layui-icon">&#x1006;</i>关闭其他标签</td>
        </tr>
        <tr class="card-close-all">
            <td><i class="layui-icon">&#x1006;</i>关闭所有标签</td>
        </tr>
    </table>
</div>

<div class="mask">
    <img src="frame/static/image/login_bg2.jpg" class="bg-login" alt=""/>
    <form class="layui-form mask-form" action="">
        <div class="main-logOut" id="">已锁屏，请重新登录</div>
    </form>
</div>
</body>
<script type="text/javascript" src="frame/layui/layui.js"></script>
<script type="text/javascript" src="frame/static/js/vip_comm.js"></script>
<script type="text/javascript" src="frame/underscore-min.js"></script>
<script type="text/javascript" src="js/user.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<script type="text/javascript">
    var parentForm,parentLaypage,layer,parentFmsUtil,parentLaydate,parentVipTable,mask;//最外层的form 模块
    layui.use(['layer', 'vip_nav', 'element', 'form', 'laypage','laydate', 'fms_util', 'table', 'vip_table', 'cookie', 'base64', 'upload'], function () {
        // 操作对象
        layer = layui.layer,
            $ = layui.jquery,
            vipNav = layui.vip_nav,
            parentForm = layui.form,
            base64 = layui.base64,
            parentLaypage = layui.laypage,
            element = layui.element,
            fmsUtil = layui.fms_util,
            parentTable = layui.table,
            parentLaydate = layui.laydate,
            upload = layui.upload,
            mask='',
            parentVipTable = layui.vip_table;

        parentFmsUtil = layui.fms_util;
        var menuData = {
            isSuccess:true,
            data:[
                {'name':'警告',
                    url:"#",
                    data:[
                        {'name':'警告库',  'url':'/alarm/alarm-library.html',data:0},
                        {'name':'警告查询',  'url':'/alarm/alarm-query.html',data:0},
                        {'name':'警告设置',  'url':'/alarm/alarm-setup.html',data:0}
                    ]
                },
                {'name':'系统',
                    url:"#",
                    data:[
                        {'name':'警告',  'url':'/system/resources.html',data:0},
                        {'name':'警告',  'url':'/system/setup.html',data:0}
                    ]
                }
            ]

        }
        main.initMenu({fmsUtil: parentFmsUtil, vipNav: vipNav, menuData: menuData});
        main.init();
        // 菜单的点击事件
        $(document).on('click', '.layui-nav a', function () {
            var dataHref = $(this).attr("data-href");
            $("#iframe").attr("src",dataHref);
        });

        //点击二级菜单图标的变化
        $(document).on('click', '.layui-nav-itemed .layui-nav-child dd>a', function () {
            $(this).parents("li").siblings().find("a").removeClass("layui-nav-itemed-a");
        });
        //点击三级菜单样式的变化
        $(document).on('click', '.layui-nav-itemed .layui-nav-child dd ol li a', function () {
            $(this).parents("dd").siblings().find("a").removeClass("layui-nav-itemed-a ");
            $(this).parents("dl").siblings("a").removeClass("layui-nav-itemed-a");
        });

        // $('#user_name').html(API.userName());
        var userId = API.userId();
        // if (userId == undefined || userId == "null") {
        //     parentFmsUtil.replaceHref(pathUrl + "/login.html");
        //     return
        // }
        $('#login_name').html(API.account());

        User.config({jquery: $, fmsUtil: parentFmsUtil, base64: base64});
        User.method().initMain();
        // vipNav.main(pathUrl+'/json/supplier/nav_main.json','side-main',false);

        mask=function(){main.mask(fmsUtil,$)};

        //锁屏
         mask();
        $(".critical").html(10);
        $(".major").html(30);
        $(".minor").html(5);
        $(".warningNum").html(8);
        // 告警统计
        function alarmStatistics(){
            fmsUtil.doAjax({
                action: " ",
                data: {userId: API.userId()},
                type: "post",
                success: function (data) {
                    if (data.isSuccess) {
                        $(".critical").html(10);
                        $(".major").html(30);
                        $(".minor").html(5);
                        $(".warningNum").html(8);
                    }else{
                        fmsUtil.msg(data.description);
                    }
                }
            });
        }
        // alarmStatistics()
        // 告警统计的定时请求（目前5分钟）
        // setInterval(alarmStatistics,300000);
        // // 告警统计按钮
        $(".alarmStatistics").click(function(){
            fmsUtil.replaceHref(pathUrl+"/main.html")

        })
    });
</script>
</html>
